package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.StrategyCollect;
import cn.wolfcode.trip.base.mapper.StrategyCollectMapper;
import cn.wolfcode.trip.base.service.IStrategyCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StrategyCollectServiceImpl implements IStrategyCollectService {
   @Autowired
    private StrategyCollectMapper strategyCollectMapper;

    @Override
    public StrategyCollect get(Long userId, Long strateyId) {
        return strategyCollectMapper.selectByUserIdAndStrategyId(userId,strateyId);
    }

    @Override
    public void delete(Integer id) {
        strategyCollectMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void save(StrategyCollect strategyCollect) {
        strategyCollectMapper.insert(strategyCollect);
    }

    @Override
    public int selectCount(Long strategyId) {
        return strategyCollectMapper.selectCount(strategyId);
    }


}
